#!/usr/bin/env bash

if [ `whoami` != "root" ];then
  echo "must be root"
  exit 1
fi

host=$1
if [ -z "$host" ]
then
  host='http://dev8.cn:8000/static/ops'
fi

curl -fsSL $host/ubuntu-server.sh | bash

echo "chrome..."
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub  | sudo apt-key add -

cat <<EOF >/etc/apt/sources.list.d/chrome.list
deb http://dl.google.com/linux/chrome/deb/ stable main
EOF

#第二种方法安装
#wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P /opt/ -N
#dpkg -i /opt/google-chrome-stable_current_amd64.deb


echo "完成。"
#使用方法
# 首先安装 curl  , 设置 root 密码： sudo passwd root , 以 root 执行： sudo -s

# curl -fsSL http://dev8.cn:8000/static/ops/ubuntu-desk.sh | bash